package com.example.smartmedicalsystem.repository;

import com.example.smartmedicalsystem.entity.Doctor;
import com.example.smartmedicalsystem.entity.Department;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface DoctorRepository extends JpaRepository<Doctor, Long> {
    // 模糊查询医生姓名
    List<Doctor> findByNameContaining(String name);

    // 根据关联的用户用户名查找医生信息
    Optional<Doctor> findByUser_Username(String username);

    // 根据科室查询医生列表
    List<Doctor> findByDepartment(Department department);
}
